package org.roulette;

import java.io.File;
import java.io.IOException;
import java.util.List;
import org.roulette.core.Bet;
import org.roulette.core.Better;
import org.roulette.core.Wheel;
import org.roulette.exception.IllegalInputException;
import org.roulette.generator.NumberGenerator;
import org.roulette.generator.StaticNumberGenerator;
import org.roulette.strategy.LastSequenceStrategy;
import org.roulette.utils.Configuration;
import org.roulette.utils.RouletteType;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) throws IOException, IllegalInputException
    {
        System.out.println("Start");
		List<File> files = Configuration.getStaticNumberFiles(RouletteType.european);
		NumberGenerator ng = new StaticNumberGenerator(files.get(0));
		Wheel wheel = new Wheel(ng, RouletteType.european);
		Better better = new Better(wheel, 100, new LastSequenceStrategy());
		for(int i = 0; i<1000;i++){
			wheel.placeBets();
			wheel.rotate();
		}
		System.out.println("amount: "+better.getMoney());
		int winCount = 0;
		int lossCount = 0;
		for(Bet bet: better.getHistory()){
			if(bet.isWin())
				winCount++;
			else
				lossCount++;
		}
		System.out.println("win: "+winCount+", loss: "+lossCount);
    }
}
